package com.fs.m.server.domain;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 请求结果信息
 *
 * User: zhuguoyin
 * Date: 13-10-7
 * Time: 下午1:15
 * To change this template use File | Settings | File Templates.
 */
public class Result implements Serializable {

    private String code;

    private String message;

    private Map<String, Object> data;

    public Result() {
        this.code = ResultCode.SUCCESS.getCode();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public void addResultData(String key, Object o) {
        if (this.data == null) {
            this.data = new HashMap<String, Object>();
        }
        this.data.put(key, o);
    }
}
